<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link href="./index.css" rel="stylesheet" type="text/css">
    <title>坦克</title>
</head>

<body>
    <div class="map">
    </div>
    <div id="left">
        <p class="now">当前是第1关</p>
        <button id="restart">
            重来
        </button>
    </div>
</body>

</html>
<script>
    function getQueryVariable(variable) {
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        for (var i = 0; i < vars.length; i++) {
            var pair = vars[i].split("=");
            if (pair[0] == variable) {
                return pair[1];
            }
        }
        return (false);
    }
    window.onload = function () {
        document.getElementsByClassName('now')[0].innerHTML = `当前是第${parseInt(getQueryVariable('level'))+1||1}关`
        document.getElementById('restart').addEventListener('click', function () {
            window.location.href = window.location.pathname
        })
    }
</script>
<script src="./js/bullet.js"></script>
<script src="./js/tree.js"></script>
<script src="./js/map.js"></script>
<script src="./js/tank.js"></script>
<script src="./js/softWall.js"></script>
<script src="./js/home.js"></script>
<script src="./js/hardWall.js"></script>
<script src="./js/mytank.js"></script>
<script src="./js/index.js"></script>